package com.zysc.processflow.common.util;

import java.lang.reflect.Method;

public class ReflectionUtils {
    public static Object getMethodExcuteResult(String classMethod,Object obj){
        Object result = null;
        try{
            int lastPointIndex = classMethod.lastIndexOf(".");
            String classFullName = classMethod.substring(0, lastPointIndex);
            String method = classMethod.substring(lastPointIndex+1);
            Class clazz = Class.forName(classFullName);
            Object tarObject = clazz.newInstance();
            Method tarMethod = clazz.getMethod(method,String.class);
            result = tarMethod.invoke(tarObject,obj);
        }catch(Exception e){

            System.out.println(e);
        }
        return result;
    }
}
